<template>
  <div class="team flex flex-column">
    <van-nav-bar title="我的团队" left-text="返回" left-arrow @click-left="onClickLeft" />
    <div class="team-list flex-1">
      <div class="team-item flex" v-for="team in team_list" :key="team.username">
        <div class="team-icon">
          <img src="../assets/photo.svg" />
        </div>
        <div class="team-main flex-1">
          <div class="team-coontent">{{team.nickname||team.username }}</div>
          <div class="team-bottom flex flex-content-between">
            <div class="id">ID:{{ team.uid }}</div>
            <!-- <div class="more flex flex-center">+30积分</div> -->
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script lang="ts" name="ChildView" setup>
import { showDialog } from 'vant';
import {useRouter} from 'vue-router'
import {inject, ref} from "vue";
import {getCurrentInstance} from "@vue/runtime-core";
const router = useRouter()
const $ajax: any = inject("$ajax")
const $api: any = inject("$api")
const currentInstance: any = getCurrentInstance()
const $this = currentInstance.proxy
let team_list: any = ref([]);
async function get_team_list() {
  const data = await $ajax(
      {
        api: $api.team_list,
      }
  )
  team_list.value = data.data.teamList
}

get_team_list();
//返回
const onClickLeft = () => {
  history.back()
}
</script>
<style lang="less" scoped>
.team{
  height: 100%;
  font-size: 0.16rem;
  .team-list {
    overflow: auto;
      .team-item {
        height: 0.7rem;
        background: #fff;
        padding: 0.06rem;
        margin-top:0;
        &:not(last-child){
          border-bottom: 1px solid #e2eeff
        }
        // &:last-child{
        //   border-bottom: 0
        // }
        .team-icon {
          width: 0.45rem;
          font-size: 0.18rem;
          color: #628cff;
          img{
            width: 100%;
          }
        }
        .team-main {
          padding: 0 0.12rem;
          .team-bottom {
            margin-top: 0.06rem;
            .id {
              color: #bfbfbf;
              font-size: 0.13rem;
              :deep(i) {
                margin-right: 0.03rem;
              }
            }
            .more {
              width: 0.78rem;
              height: 0.26rem;
              flex-shrink: 0;
              border-radius: 0.34rem;
              background: linear-gradient(99deg, #f1f4ff 1.64%, #e1e7fe 27%, #d5ebff 98.52%);
              color: #4e7dff;
              font-family: 'PingFang SC';
              font-size: 0.12rem;
              font-style: normal;
              font-weight: 400;
              line-height: normal;
            }
          }
        }
      }
    }
}
</style>
